import numpy as np
import matplotlib.pyplot as plt

N = 1000
x = np.random.randn(N)
y1 = np.random.randn(len(x))

y2=x+np.random.randn(len(x))*0.1
plt.scatter(x,y2)

y3=-1*x+np.random.randn(len(x))*0.1
plt.scatter(x,y3)

N = 1000
x = np.random.rand(N)
y = np.random.rand(N)
def normal():
    height = [161, 170, 182, 175, 173, 165]
    weight = [50, 58, 80, 70, 69, 55]
    plt.scatter(height, weight)
    plt.show()


def normal2():
    global N, x, y1
    plt.scatter(x, y1)
    plt.show()


def stock():
    global open, close, change, yesterday, today
    open, close = np.loadtxt('../../000001.csv', delimiter=',', skiprows=1, usecols=(1, 4), unpack=True)
    change = close - open
    yesterday = change[:-1]
    today = change[1:]
    plt.scatter(today, yesterday)
    plt.show()





def kind():
    s = 200
    marker = 'v'
    c = 'green'
    alpha = 1
    plt.scatter(x, y1, s=50, marker='o', c='red', alpha=0.5)
    plt.show()




def stock_():
    global open, close, change, yesterday, today
    open, close = np.loadtxt('../../000001.csv', delimiter=',', skiprows=1, usecols=(1, 4), unpack=True)
    change = close - open
    yesterday = change[:-1]
    today = change[1:]
    plt.scatter(yesterday, today, s=5, c='r', alpha=0.5)
    plt.show()

stock_()





